import request from '@/router/axios'

const path = '/entrance-guard/guardIcInfo'
export function fetchIcList(id, query) {
  return request({
    url: `${path}/page/${id}`,
    method: 'get',
    params: query
  })
}

export function addIcObjByHouseOwnerId(obj) {
  return request({
    url: `${path}/addByHouseOwnerId`,
    method: 'post',
    data: obj
  })
}

export function addIcObjByUserId(obj) {
  return request({
    url: `${path}/addByUserId`,
    method: 'post',
    data: obj
  })
}

export function delIcObj(obj) {
  return request({
    url: `${path}`,
    method: 'delete',
    data: obj
  })
}

export function putIcObj(obj) {
  return request({
    url: `${path}`,
    method: 'put',
    data: obj
  })
}

export function getIcInfoById(id, query) {
  return request({
    url: `/entrance-guard/guardIcInfo/getIcInfoById/${id}`,
    method: 'get',
    params: query
  })
}

export function updateIcObj(obj) {
  return request({
    url: `${path}/updateStatusByIcInfoId`,
    method: 'put',
    data: obj
  })
}
